Skip to content

gh-156106: Add tests for setting and deleting attributes defined in C - #156107

Merged
serhiy-storchaka merged 5 commits into
python:mainfrom
serhiy-storchaka:c-attribute-mutation-tests
Aug 21, 2026
Merged

gh-156106: Add tests for setting and deleting attributes defined in C#156107
serhiy-storchaka merged 5 commits into
python:mainfrom
serhiy-storchaka:c-attribute-mutation-tests

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 20, 2026

Copy link
Copy Markdown
Member

Tests for the attributes defined with PyMemberDef and PyGetSetDef which were not covered: setting a value of an accepted type, of a wrong type or an invalid value, and deleting the attribute.

They are added to the existing tests of the corresponding attributes where such tests exist.

Covered: the plain object members of exceptions, function.__code__, __doc__ and __kwdefaults__, frame.f_trace, f_trace_lines and f_trace_opcodes, the attributes of _ssl._SSLContext and _ssl._SSLSocket, sqlite3 isolation_level, arraysize and autocommit, ctypes raw, contents, argtypes, restype and errcheck, the C Pickler and Unpickler attributes, _io _blksize, _finalizing and _CHUNK_SIZE, the private attributes of decimal.Context, defaultdict.default_factory, Future._cancel_message and the members of select.kevent.

…d in C

Test setting a value of an accepted type, of a wrong type and an invalid
value, and deleting the attribute, for the attributes defined with
PyMemberDef and PyGetSetDef which were not covered.
@serhiy-storchaka
serhiy-storchaka merged commit cdca502 into python:main Aug 21, 2026
86 of 89 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the c-attribute-mutation-tests branch August 21, 2026 13:58
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 21, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker cdca5021d5b6c2cba8121b639bae1642dfe51ff3 3.13

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.15 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker cdca5021d5b6c2cba8121b639bae1642dfe51ff3 3.15

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker cdca5021d5b6c2cba8121b639bae1642dfe51ff3 3.14

@bedevere-app

bedevere-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

GH-156184 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 21, 2026
serhiy-storchaka added a commit that referenced this pull request Aug 21, 2026
…ed in C (GH-156107) (ПР-156184)

Test setting a value of an accepted type, of a wrong type and an invalid
value, and deleting the attribute, for the attributes defined with
PyMemberDef and PyGetSetDef which were not covered.

(cherry picked from commit cdca502)
@bedevere-app

bedevere-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

GH-156191 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant